]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Clean up code a tiny bit
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 11 Mar 2013 21:11:51 +0000 (17:11 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 12 Mar 2013 15:58:51 +0000 (11:58 -0400)
Remove some duplication by reusing a method.

https://bugzilla.gnome.org/show_bug.cgi?id=695659

js/ui/messageTray.js

index 83a0425a454e97e9e5c809eb9003e04c400aee8b..2c1f328ef7804f962bc1955dee9099a1391f2998 100644 (file)
@@ -2620,10 +2620,9 @@ const MessageTray = new Lang.Class({
     },
 
     _expandNotification: function(autoExpanding) {
-        // Don't grab focus in notifications that are auto-expanded.
+        // Don't focus notifications that are auto-expanding.
         if (!autoExpanding)
-            this._grabHelper.grab({ actor: this._notification.actor,
-                                    grabFocus: true });
+            this._ensureNotificationFocused();
 
         if (!this._notificationExpandedId)
             this._notificationExpandedId =
@@ -2653,8 +2652,6 @@ const MessageTray = new Lang.Class({
         }
     },
 
-    // We use this function to grab focus when the user moves the pointer
-    // to a notification with CRITICAL urgency that was already auto-expanded.
     _ensureNotificationFocused: function() {
         this._grabHelper.grab({ actor: this._notification.actor,
                                 grabFocus: true });